package c.e.a.b.f.b;

import android.os.Handler;
import c.e.a.b.b.j.c;
import c.e.a.b.e.c.dc;
import java.util.Objects;

/* compiled from: com.google.android.gms:play-services-measurement-impl@@18.0.0 */
public abstract class i {
    public static volatile Handler d;
    public final t5 a;
    public final Runnable b;
    public volatile long c;

    public i(t5 t5Var) {
        Objects.requireNonNull(t5Var, "null reference");
        this.a = t5Var;
        this.b = new k(this, t5Var);
    }

    public abstract void a();

    public final void b(long j) {
        c();
        if (j >= 0) {
            Objects.requireNonNull((c) this.a.b());
            this.c = System.currentTimeMillis();
            if (!d().postDelayed(this.b, j)) {
                this.a.d().f.b("Failed to schedule delayed post. time", Long.valueOf(j));
            }
        }
    }

    public final void c() {
        this.c = 0;
        d().removeCallbacks(this.b);
    }

    public final Handler d() {
        if (d != null) {
            return d;
        }
        Handler handler;
        synchronized (i.class) {
            if (d == null) {
                d = new dc(this.a.e().getMainLooper());
            }
            handler = d;
        }
        return handler;
    }
}
